# FreeSWITCH Rust Client Test Script
# For Windows PowerShell

Write-Host "=== FreeSWITCH Rust Client Test ===" -ForegroundColor Green

# Set log level
$env:RUST_LOG = "info"

# Test 1: Get FreeSWITCH status
Write-Host "`n1. Testing FreeSWITCH status..." -ForegroundColor Yellow
try {
    .\target\release\freeswitch-client.exe status
} catch {
    Write-Host "Status check failed: $_" -ForegroundColor Red
}

# Test 2: List active channels
Write-Host "`n2. Testing list channels..." -ForegroundColor Yellow
try {
    .\target\release\freeswitch-client.exe list-channels
} catch {
    Write-Host "List channels failed: $_" -ForegroundColor Red
}

# Test 3: Listen to events (5 seconds)
Write-Host "`n3. Testing event listening (5 seconds)..." -ForegroundColor Yellow
try {
    .\target\release\freeswitch-client.exe listen -d 5
} catch {
    Write-Host "Event listening failed: $_" -ForegroundColor Red
}

# Test 4: Make a call (requires configured user in FreeSWITCH)
Write-Host "`n4. Testing make call..." -ForegroundColor Yellow
Write-Host "Note: This requires a configured user (like user/1000) and proper dialplan in FreeSWITCH" -ForegroundColor Cyan
Write-Host "To test dialing, run: .\target\release\freeswitch-client.exe call -n 1234567890" -ForegroundColor Cyan

Write-Host "`n=== Test Complete ===" -ForegroundColor Green
Write-Host "`nUsage Instructions:" -ForegroundColor Cyan
Write-Host "- Ensure FreeSWITCH server is running" -ForegroundColor White
Write-Host "- Ensure ESL port (8021) is accessible" -ForegroundColor White
Write-Host "- Default password is 'ClueCon', can be modified in FreeSWITCH config" -ForegroundColor White
Write-Host "- To connect to remote server, use: -h [IP_ADDRESS] -p [PORT] -w [PASSWORD]" -ForegroundColor White 